home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / StdEnv / Clean System Files / StdInt.abc < prev    next >
Encoding:
Text File  |  1997-06-17  |  18.3 KB  |  1,511 lines  |  [TEXT/3PRM]

  1. .comp 914 010111011
  2. .code       0       0       0
  3. .start _nostart_
  4. .depend "StdBool"
  5. .depend "StdMisc"
  6. .depend "StdOverloaded"
  7. .depend "StdInt"
  8. .endinfo
  9. .implab _cycle_in_spine
  10. .implab _type_error
  11. .implab _hnf
  12. .impdesc _ind
  13. .implab _indirection _eaind
  14. .impdesc e_system_dif
  15. .implab e_system_nif e_system_eaif
  16. .impdesc e_system_dAP
  17. .implab e_system_nAP e_system_eaAP
  18. .implab e_system_sif
  19. .implab e_system_sAP
  20. .impdesc _Cons
  21. .impdesc _Nil
  22. .impdesc _Tuple
  23. .impdesc d_S.1
  24. .implab n_S.1 ea_S.1
  25. .impdesc d_S.2
  26. .implab n_S.2 ea_S.2
  27. .impdesc d_S.3
  28. .implab n_S.3 ea_S.3
  29. .impdesc d_S.4
  30. .implab n_S.4 ea_S.4
  31. .impdesc d_S.5
  32. .implab n_S.5 ea_S.5
  33. .impdesc d_S.6
  34. .implab n_S.6 ea_S.6
  35. .implab _driver
  36. .string m_StdInt "StdInt"
  37. .implab e_StdMisc_sabort
  38. .export e_StdInt_d+;i
  39. .export e_StdInt_s+;i
  40. .export e_StdInt_n+;i
  41. .desc e_StdInt_d+;i e_StdInt_n+;i e_StdInt_l+;i 2 "+ (Int)"
  42. .o 2 0
  43. e_StdInt_l+;i
  44.     repl_args 1 1
  45. .d 2 0
  46.     jsr ea3
  47. .o 0 1 i
  48.     buildI_b 0
  49.     pop_b 1
  50. .d 1 0
  51.     rtn
  52. .n 2 e_StdInt_d+;i
  53. .o 1 0
  54. e_StdInt_n+;i
  55.     push_node _cycle_in_spine 2
  56. .d 2 0
  57.     jsr ea3
  58. .o 0 1 i
  59.     fillI_b 0 0
  60.     pop_b 1
  61. .d 1 0
  62.     rtn
  63. .o 2 0
  64. ea3
  65.     jsr_eval 1
  66.     jsr_eval 0
  67.     pushI_a 1
  68.     pushI_a 0
  69.     pop_a 2
  70. .o 0 2 ii
  71. e_StdInt_s+;i
  72. .o 0 2 ii
  73. s3
  74. .inline +;i
  75.     addI
  76. .end
  77. .d 0 1 i
  78.     rtn
  79. .export e_StdInt_d-;i
  80. .export e_StdInt_s-;i
  81. .export e_StdInt_n-;i
  82. .desc e_StdInt_d-;i e_StdInt_n-;i e_StdInt_l-;i 2 "- (Int)"
  83. .o 2 0
  84. e_StdInt_l-;i
  85.     repl_args 1 1
  86. .d 2 0
  87.     jsr ea4
  88. .o 0 1 i
  89.     buildI_b 0
  90.     pop_b 1
  91. .d 1 0
  92.     rtn
  93. .n 2 e_StdInt_d-;i
  94. .o 1 0
  95. e_StdInt_n-;i
  96.     push_node _cycle_in_spine 2
  97. .d 2 0
  98.     jsr ea4
  99. .o 0 1 i
  100.     fillI_b 0 0
  101.     pop_b 1
  102. .d 1 0
  103.     rtn
  104. .o 2 0
  105. ea4
  106.     jsr_eval 1
  107.     jsr_eval 0
  108.     pushI_a 1
  109.     pushI_a 0
  110.     pop_a 2
  111. .o 0 2 ii
  112. e_StdInt_s-;i
  113. .o 0 2 ii
  114. s4
  115. .inline -;i
  116.     subI
  117. .end
  118. .d 0 1 i
  119.     rtn
  120. .export e_StdInt_dzero;i
  121. .export e_StdInt_szero;i
  122. .export e_StdInt_nzero;i
  123. .desc e_StdInt_dzero;i e_StdInt_nzero;i e_StdInt_lzero;i 0 "zero (Int)"
  124. .o 1 0
  125. e_StdInt_lzero;i
  126.     halt
  127. .n 0 e_StdInt_dzero;i
  128. .o 1 0
  129. e_StdInt_nzero;i
  130.     push_node _cycle_in_spine 0
  131. .d 0 0
  132.     jsr ea5
  133. .o 0 1 i
  134.     fillI_b 0 0
  135.     pop_b 1
  136. .d 1 0
  137.     rtn
  138. .o 0 0
  139. ea5
  140. .o 0 0
  141. e_StdInt_szero;i
  142. .o 0 0
  143. s5
  144. .inline zero;i
  145.     pushI 0
  146. .end
  147. .d 0 1 i
  148.     rtn
  149. .export e_StdInt_d*;i
  150. .export e_StdInt_s*;i
  151. .export e_StdInt_n*;i
  152. .desc e_StdInt_d*;i e_StdInt_n*;i e_StdInt_l*;i 2 "* (Int)"
  153. .o 2 0
  154. e_StdInt_l*;i
  155.     repl_args 1 1
  156. .d 2 0
  157.     jsr ea6
  158. .o 0 1 i
  159.     buildI_b 0
  160.     pop_b 1
  161. .d 1 0
  162.     rtn
  163. .n 2 e_StdInt_d*;i
  164. .o 1 0
  165. e_StdInt_n*;i
  166.     push_node _cycle_in_spine 2
  167. .d 2 0
  168.     jsr ea6
  169. .o 0 1 i
  170.     fillI_b 0 0
  171.     pop_b 1
  172. .d 1 0
  173.     rtn
  174. .o 2 0
  175. ea6
  176.     jsr_eval 1
  177.     jsr_eval 0
  178.     pushI_a 1
  179.     pushI_a 0
  180.     pop_a 2
  181. .o 0 2 ii
  182. e_StdInt_s*;i
  183. .o 0 2 ii
  184. s6
  185. .inline *;i
  186.     mulI
  187. .end
  188. .d 0 1 i
  189.     rtn
  190. .export e_StdInt_d/;i
  191. .export e_StdInt_s/;i
  192. .export e_StdInt_n/;i
  193. .desc e_StdInt_d/;i e_StdInt_n/;i e_StdInt_l/;i 2 "/ (Int)"
  194. .o 2 0
  195. e_StdInt_l/;i
  196.     repl_args 1 1
  197. .d 2 0
  198.     jsr ea7
  199. .o 0 1 i
  200.     buildI_b 0
  201.     pop_b 1
  202. .d 1 0
  203.     rtn
  204. .n 2 e_StdInt_d/;i
  205. .o 1 0
  206. e_StdInt_n/;i
  207.     push_node _cycle_in_spine 2
  208. .d 2 0
  209.     jsr ea7
  210. .o 0 1 i
  211.     fillI_b 0 0
  212.     pop_b 1
  213. .d 1 0
  214.     rtn
  215. .o 2 0
  216. ea7
  217.     jsr_eval 1
  218.     jsr_eval 0
  219.     pushI_a 1
  220.     pushI_a 0
  221.     pop_a 2
  222. .o 0 2 ii
  223. e_StdInt_s/;i
  224. .o 0 2 ii
  225. s7
  226. .inline /;i
  227.     divI
  228. .end
  229. .d 0 1 i
  230.     rtn
  231. .export e_StdInt_done;i
  232. .export e_StdInt_sone;i
  233. .export e_StdInt_none;i
  234. .desc e_StdInt_done;i e_StdInt_none;i e_StdInt_lone;i 0 "one (Int)"
  235. .o 1 0
  236. e_StdInt_lone;i
  237.     halt
  238. .n 0 e_StdInt_done;i
  239. .o 1 0
  240. e_StdInt_none;i
  241.     push_node _cycle_in_spine 0
  242. .d 0 0
  243.     jsr ea8
  244. .o 0 1 i
  245.     fillI_b 0 0
  246.     pop_b 1
  247. .d 1 0
  248.     rtn
  249. .o 0 0
  250. ea8
  251. .o 0 0
  252. e_StdInt_sone;i
  253. .o 0 0
  254. s8
  255. .inline one;i
  256.     pushI 1
  257. .end
  258. .d 0 1 i
  259.     rtn
  260. .export e_StdInt_d^;i
  261. .export e_StdInt_s^;i
  262. .export e_StdInt_n^;i
  263. .desc e_StdInt_d^;i e_StdInt_n^;i e_StdInt_l^;i 2 "^ (Int)"
  264. .o 2 0
  265. e_StdInt_l^;i
  266.     repl_args 1 1
  267. .d 2 0
  268.     jsr ea9
  269. .o 0 1 i
  270.     buildI_b 0
  271.     pop_b 1
  272. .d 1 0
  273.     rtn
  274. .n 2 e_StdInt_d^;i
  275. .o 1 0
  276. e_StdInt_n^;i
  277.     push_node _cycle_in_spine 2
  278. .d 2 0
  279.     jsr ea9
  280. .o 0 1 i
  281.     fillI_b 0 0
  282.     pop_b 1
  283. .d 1 0
  284.     rtn
  285. .o 2 0
  286. ea9
  287.     jsr_eval 1
  288.     jsr_eval 0
  289.     pushI_a 1
  290.     pushI_a 0
  291.     pop_a 2
  292. .o 0 2 ii
  293. e_StdInt_s^;i
  294. .o 0 2 ii
  295. s9
  296.     pushI 0
  297.     push_b 2
  298.     ltI
  299.     jmp_false else.1
  300.     jmp then.1
  301. then.1
  302.     buildAC "^ (Int) called with negative power argument"
  303.     pop_b 2
  304. .d 1 0
  305.     jsr e_StdMisc_sabort
  306. .o 1 0
  307.     pushI_a 0
  308.     pop_a 1
  309. .d 0 1 i
  310.     rtn
  311. else.1
  312.     push_b 1
  313.     push_b 1
  314.     update_b 1 3
  315.     update_b 0 2
  316.     pop_b 2
  317. .d 0 2 ii
  318.     jmp s2
  319. .o 0 2 ii
  320. s2
  321.     eqI_b 0 1
  322.     jmp_true case.2
  323.     jmp case.3
  324. case.2
  325.     pop_b 2
  326.     pushI 1
  327. .d 0 1 i
  328.     rtn
  329. case.3
  330.     push_b 1
  331.     pushI 1
  332.     and%
  333.     pushI 0
  334.     eqI
  335.     jmp_false else.4
  336.     jmp then.4
  337. then.4
  338.     pushI 1
  339.     push_b 2
  340.     shiftr%
  341.     push_b 1
  342.     update_b 1 3
  343.     update_b 0 2
  344.     pop_b 2
  345. .d 0 2 ii
  346.     jsr s2
  347. .o 0 1 i
  348.     push_b 0
  349.     push_b 1
  350.     update_b 1 2
  351.     update_b 0 1
  352.     pop_b 1
  353.     mulI
  354. .d 0 1 i
  355.     rtn
  356. else.4
  357.     pushI 1
  358.     push_b 2
  359.     shiftr%
  360.     push_b 1
  361. .d 0 2 ii
  362.     jsr s2
  363. .o 0 1 i
  364.     push_b 0
  365.     push_b 2
  366.     mulI
  367.     push_b 1
  368.     push_b 1
  369.     update_b 1 2
  370.     update_b 0 1
  371.     pop_b 1
  372.     update_b 1 4
  373.     update_b 0 3
  374.     pop_b 3
  375.     mulI
  376. .d 0 1 i
  377.     rtn
  378. .export e_StdInt_dabs;i
  379. .export e_StdInt_sabs;i
  380. .export e_StdInt_nabs;i
  381. .desc e_StdInt_dabs;i e_StdInt_nabs;i e_StdInt_labs;i 1 "abs (Int)"
  382. .o 2 0
  383. e_StdInt_labs;i
  384.     pop_a 1
  385. .d 1 0
  386.     jsr ea10
  387. .o 0 1 i
  388.     buildI_b 0
  389.     pop_b 1
  390. .d 1 0
  391.     rtn
  392. .n 1 e_StdInt_dabs;i
  393. .o 1 0
  394. e_StdInt_nabs;i
  395.     push_node _cycle_in_spine 1
  396. .d 1 0
  397.     jsr ea10
  398. .o 0 1 i
  399.     fillI_b 0 0
  400.     pop_b 1
  401. .d 1 0
  402.     rtn
  403. .o 1 0
  404. ea10
  405.     jsr_eval 0
  406.     pushI_a 0
  407.     pop_a 1
  408. .o 0 1 i
  409. e_StdInt_sabs;i
  410. .o 0 1 i
  411. s10
  412.     pushI 0
  413.     push_b 1
  414.     ltI
  415.     jmp_false else.5
  416.     jmp then.5
  417. then.5
  418.     push_b 0
  419.     pushI 0
  420.     update_b 1 2
  421.     update_b 0 1
  422.     pop_b 1
  423.     subI
  424. .d 0 1 i
  425.     rtn
  426. else.5
  427. .d 0 1 i
  428.     rtn
  429. .export e_StdInt_dsign;i
  430. .export e_StdInt_ssign;i
  431. .export e_StdInt_nsign;i
  432. .desc e_StdInt_dsign;i e_StdInt_nsign;i e_StdInt_lsign;i 1 "sign (Int)"
  433. .o 2 0
  434. e_StdInt_lsign;i
  435.     pop_a 1
  436. .d 1 0
  437.     jsr ea11
  438. .o 0 1 i
  439.     buildI_b 0
  440.     pop_b 1
  441. .d 1 0
  442.     rtn
  443. .n 1 e_StdInt_dsign;i
  444. .o 1 0
  445. e_StdInt_nsign;i
  446.     push_node _cycle_in_spine 1
  447. .d 1 0
  448.     jsr ea11
  449. .o 0 1 i
  450.     fillI_b 0 0
  451.     pop_b 1
  452. .d 1 0
  453.     rtn
  454. .o 1 0
  455. ea11
  456.     jsr_eval 0
  457.     pushI_a 0
  458.     pop_a 1
  459. .o 0 1 i
  460. e_StdInt_ssign;i
  461. .o 0 1 i
  462. s11
  463.     pushI 0
  464.     push_b 1
  465.     eqI
  466.     jmp_false else.6
  467.     jmp then.6
  468. then.6
  469.     pop_b 1
  470.     pushI 0
  471. .d 0 1 i
  472.     rtn
  473. else.6
  474.     pushI 0
  475.     push_b 1
  476.     update_b 1 2
  477.     update_b 0 1
  478.     pop_b 1
  479.     ltI
  480.     jmp_false else.7
  481.     jmp then.7
  482. then.7
  483.     pushI -1
  484. .d 0 1 i
  485.     rtn
  486. else.7
  487.     pushI 1
  488. .d 0 1 i
  489.     rtn
  490. .export e_StdInt_d~;i
  491. .export e_StdInt_s~;i
  492. .export e_StdInt_n~;i
  493. .desc e_StdInt_d~;i e_StdInt_n~;i e_StdInt_l~;i 1 "~ (Int)"
  494. .o 2 0
  495. e_StdInt_l~;i
  496.     pop_a 1
  497. .d 1 0
  498.     jsr ea12
  499. .o 0 1 i
  500.     buildI_b 0
  501.     pop_b 1
  502. .d 1 0
  503.     rtn
  504. .n 1 e_StdInt_d~;i
  505. .o 1 0
  506. e_StdInt_n~;i
  507.     push_node _cycle_in_spine 1
  508. .d 1 0
  509.     jsr ea12
  510. .o 0 1 i
  511.     fillI_b 0 0
  512.     pop_b 1
  513. .d 1 0
  514.     rtn
  515. .o 1 0
  516. ea12
  517.     jsr_eval 0
  518.     pushI_a 0
  519.     pop_a 1
  520. .o 0 1 i
  521. e_StdInt_s~;i
  522. .o 0 1 i
  523. s12
  524. .inline ~;i
  525.     pushI 0
  526.     subI
  527. .end
  528. .d 0 1 i
  529.     rtn
  530. .export e_StdInt_d==;i
  531. .export e_StdInt_s==;i
  532. .export e_StdInt_n==;i
  533. .desc e_StdInt_d==;i e_StdInt_n==;i e_StdInt_l==;i 2 "== (Int)"
  534. .o 2 0
  535. e_StdInt_l==;i
  536.     repl_args 1 1
  537. .d 2 0
  538.     jsr ea13
  539. .o 0 1 b
  540.     buildB_b 0
  541.     pop_b 1
  542. .d 1 0
  543.     rtn
  544. .n 2 e_StdInt_d==;i
  545. .o 1 0
  546. e_StdInt_n==;i
  547.     push_node _cycle_in_spine 2
  548. .d 2 0
  549.     jsr ea13
  550. .o 0 1 b
  551.     fillB_b 0 0
  552.     pop_b 1
  553. .d 1 0
  554.     rtn
  555. .o 2 0
  556. ea13
  557.     jsr_eval 1
  558.     jsr_eval 0
  559.     pushI_a 1
  560.     pushI_a 0
  561.     pop_a 2
  562. .o 0 2 ii
  563. e_StdInt_s==;i
  564. .o 0 2 ii
  565. s13
  566. .inline ==;i
  567.     eqI
  568. .end
  569. .d 0 1 b
  570.     rtn
  571. .export e_StdInt_d<;i
  572. .export e_StdInt_s<;i
  573. .export e_StdInt_n<;i
  574. .desc e_StdInt_d<;i e_StdInt_n<;i e_StdInt_l<;i 2 "< (Int)"
  575. .o 2 0
  576. e_StdInt_l<;i
  577.     repl_args 1 1
  578. .d 2 0
  579.     jsr ea14
  580. .o 0 1 b
  581.     buildB_b 0
  582.     pop_b 1
  583. .d 1 0
  584.     rtn
  585. .n 2 e_StdInt_d<;i
  586. .o 1 0
  587. e_StdInt_n<;i
  588.     push_node _cycle_in_spine 2
  589. .d 2 0
  590.     jsr ea14
  591. .o 0 1 b
  592.     fillB_b 0 0
  593.     pop_b 1
  594. .d 1 0
  595.     rtn
  596. .o 2 0
  597. ea14
  598.     jsr_eval 1
  599.     jsr_eval 0
  600.     pushI_a 1
  601.     pushI_a 0
  602.     pop_a 2
  603. .o 0 2 ii
  604. e_StdInt_s<;i
  605. .o 0 2 ii
  606. s14
  607. .inline <;i
  608.     ltI
  609. .end
  610. .d 0 1 b
  611.     rtn
  612. .export e_StdInt_dtoInt;i
  613. .export e_StdInt_stoInt;i
  614. .export e_StdInt_ntoInt;i
  615. .desc e_StdInt_dtoInt;i e_StdInt_ntoInt;i e_StdInt_ltoInt;i 1 "toInt (Int)"
  616. .o 2 0
  617. e_StdInt_ltoInt;i
  618.     pop_a 1
  619. .d 1 0
  620.     jsr ea15
  621. .o 0 1 i
  622.     buildI_b 0
  623.     pop_b 1
  624. .d 1 0
  625.     rtn
  626. .n 1 e_StdInt_dtoInt;i
  627. .o 1 0
  628. e_StdInt_ntoInt;i
  629.     push_node _cycle_in_spine 1
  630. .d 1 0
  631.     jsr ea15
  632. .o 0 1 i
  633.     fillI_b 0 0
  634.     pop_b 1
  635. .d 1 0
  636.     rtn
  637. .o 1 0
  638. ea15
  639.     jsr_eval 0
  640.     pushI_a 0
  641.     pop_a 1
  642. .o 0 1 i
  643. e_StdInt_stoInt;i
  644. .o 0 1 i
  645. s15
  646. .inline toInt;i
  647.     no_op
  648. .end
  649. .d 0 1 i
  650.     rtn
  651. .export e_StdInt_dtoChar;i
  652. .export e_StdInt_stoChar;i
  653. .export e_StdInt_ntoChar;i
  654. .desc e_StdInt_dtoChar;i e_StdInt_ntoChar;i e_StdInt_ltoChar;i 1 "toChar (Int)"
  655. .o 2 0
  656. e_StdInt_ltoChar;i
  657.     pop_a 1
  658. .d 1 0
  659.     jsr ea16
  660. .o 0 1 c
  661.     buildC_b 0
  662.     pop_b 1
  663. .d 1 0
  664.     rtn
  665. .n 1 e_StdInt_dtoChar;i
  666. .o 1 0
  667. e_StdInt_ntoChar;i
  668.     push_node _cycle_in_spine 1
  669. .d 1 0
  670.     jsr ea16
  671. .o 0 1 c
  672.     fillC_b 0 0
  673.     pop_b 1
  674. .d 1 0
  675.     rtn
  676. .o 1 0
  677. ea16
  678.     jsr_eval 0
  679.     pushI_a 0
  680.     pop_a 1
  681. .o 0 1 i
  682. e_StdInt_stoChar;i
  683. .o 0 1 i
  684. s16
  685. .inline toChar;i
  686.     ItoC
  687. .end
  688. .d 0 1 c
  689.     rtn
  690. .export e_StdInt_dtoReal;i
  691. .export e_StdInt_stoReal;i
  692. .export e_StdInt_ntoReal;i
  693. .desc e_StdInt_dtoReal;i e_StdInt_ntoReal;i e_StdInt_ltoReal;i 1 "toReal (Int)"
  694. .o 2 0
  695. e_StdInt_ltoReal;i
  696.     pop_a 1
  697. .d 1 0
  698.     jsr ea17
  699. .o 0 2 r
  700.     buildR_b 0
  701.     pop_b 2
  702. .d 1 0
  703.     rtn
  704. .n 1 e_StdInt_dtoReal;i
  705. .o 1 0
  706. e_StdInt_ntoReal;i
  707.     push_node _cycle_in_spine 1
  708. .d 1 0
  709.     jsr ea17
  710. .o 0 2 r
  711.     fillR_b 0 0
  712.     pop_b 2
  713. .d 1 0
  714.     rtn
  715. .o 1 0
  716. ea17
  717.     jsr_eval 0
  718.     pushI_a 0
  719.     pop_a 1
  720. .o 0 1 i
  721. e_StdInt_stoReal;i
  722. .o 0 1 i
  723. s17
  724. .inline toReal;i
  725.     ItoR
  726. .end
  727. .d 0 2 r
  728.     rtn
  729. .export e_StdInt_dtoString;i
  730. .export e_StdInt_stoString;i
  731. .export e_StdInt_ntoString;i
  732. .desc e_StdInt_dtoString;i e_StdInt_ntoString;i e_StdInt_ltoString;i 1 "toString (Int)"
  733. .o 2 0
  734. e_StdInt_ltoString;i
  735.     pop_a 1
  736. .d 1 0
  737.     jsr ea18
  738. .o 1 0
  739.     create
  740.     push_a 1
  741.     fill ARRAY 1 _hnf 1
  742.     update_a 0 1
  743.     pop_a 1
  744. .d 1 0
  745.     rtn
  746. .n 1 e_StdInt_dtoString;i
  747. .o 1 0
  748. e_StdInt_ntoString;i
  749.     push_node _cycle_in_spine 1
  750. .d 1 0
  751.     jsr ea18
  752. .o 1 0
  753.     push_a 0
  754.     fill ARRAY 1 _hnf 2
  755.     pop_a 1
  756. .d 1 0
  757.     rtn
  758. .o 1 0
  759. ea18
  760.     jsr_eval 0
  761.     pushI_a 0
  762.     pop_a 1
  763. .o 0 1 i
  764. e_StdInt_stoString;i
  765. .o 0 1 i
  766. s18
  767. .inline toString;i
  768. .d 0 1 i
  769.     jsr ItoAC
  770. .o 1 0
  771. .end
  772. .d 1 0
  773.     rtn
  774. .export e_StdInt_dfromInt;i
  775. .export e_StdInt_sfromInt;i
  776. .export e_StdInt_nfromInt;i
  777. .desc e_StdInt_dfromInt;i e_StdInt_nfromInt;i e_StdInt_lfromInt;i 1 "fromInt (Int)"
  778. .o 2 0
  779. e_StdInt_lfromInt;i
  780.     pop_a 1
  781. .d 1 0
  782.     jsr ea19
  783. .o 0 1 i
  784.     buildI_b 0
  785.     pop_b 1
  786. .d 1 0
  787.     rtn
  788. .n 1 e_StdInt_dfromInt;i
  789. .o 1 0
  790. e_StdInt_nfromInt;i
  791.     push_node _cycle_in_spine 1
  792. .d 1 0
  793.     jsr ea19
  794. .o 0 1 i
  795.     fillI_b 0 0
  796.     pop_b 1
  797. .d 1 0
  798.     rtn
  799. .o 1 0
  800. ea19
  801.     jsr_eval 0
  802.     pushI_a 0
  803.     pop_a 1
  804. .o 0 1 i
  805. e_StdInt_sfromInt;i
  806. .o 0 1 i
  807. s19
  808. .inline fromInt;i
  809.     no_op
  810. .end
  811. .d 0 1 i
  812.     rtn
  813. .export e_StdInt_dfromInt;c
  814. .export e_StdInt_sfromInt;c
  815. .export e_StdInt_nfromInt;c
  816. .desc e_StdInt_dfromInt;c e_StdInt_nfromInt;c e_StdInt_lfromInt;c 1 "fromInt (Char)"
  817. .o 2 0
  818. e_StdInt_lfromInt;c
  819.     pop_a 1
  820. .d 1 0
  821.     jsr ea20
  822. .o 0 1 c
  823.     buildC_b 0
  824.     pop_b 1
  825. .d 1 0
  826.     rtn
  827. .n 1 e_StdInt_dfromInt;c
  828. .o 1 0
  829. e_StdInt_nfromInt;c
  830.     push_node _cycle_in_spine 1
  831. .d 1 0
  832.     jsr ea20
  833. .o 0 1 c
  834.     fillC_b 0 0
  835.     pop_b 1
  836. .d 1 0
  837.     rtn
  838. .o 1 0
  839. ea20
  840.     jsr_eval 0
  841.     pushI_a 0
  842.     pop_a 1
  843. .o 0 1 i
  844. e_StdInt_sfromInt;c
  845. .o 0 1 i
  846. s20
  847. .inline fromInt;c
  848.     ItoC
  849. .end
  850. .d 0 1 c
  851.     rtn
  852. .export e_StdInt_dfromInt;r
  853. .export e_StdInt_sfromInt;r
  854. .export e_StdInt_nfromInt;r
  855. .desc e_StdInt_dfromInt;r e_StdInt_nfromInt;r e_StdInt_lfromInt;r 1 "fromInt (Real)"
  856. .o 2 0
  857. e_StdInt_lfromInt;r
  858.     pop_a 1
  859. .d 1 0
  860.     jsr ea21
  861. .o 0 2 r
  862.     buildR_b 0
  863.     pop_b 2
  864. .d 1 0
  865.     rtn
  866. .n 1 e_StdInt_dfromInt;r
  867. .o 1 0
  868. e_StdInt_nfromInt;r
  869.     push_node _cycle_in_spine 1
  870. .d 1 0
  871.     jsr ea21
  872. .o 0 2 r
  873.     fillR_b 0 0
  874.     pop_b 2
  875. .d 1 0
  876.     rtn
  877. .o 1 0
  878. ea21
  879.     jsr_eval 0
  880.     pushI_a 0
  881.     pop_a 1
  882. .o 0 1 i
  883. e_StdInt_sfromInt;r
  884. .o 0 1 i
  885. s21
  886. .inline fromInt;r
  887.     ItoR
  888. .end
  889. .d 0 2 r
  890.     rtn
  891. .export e_StdInt_dfromInt;#
  892. .export e_StdInt_sfromInt;#
  893. .export e_StdInt_nfromInt;#
  894. .desc e_StdInt_dfromInt;# e_StdInt_nfromInt;# e_StdInt_lfromInt;# 1 "fromInt ({#})"
  895. .o 2 0
  896. e_StdInt_lfromInt;#
  897.     pop_a 1
  898. .d 1 0
  899.     jsr ea22
  900. .o 1 0
  901.     create
  902.     push_a 1
  903.     fill ARRAY 1 _hnf 1
  904.     update_a 0 1
  905.     pop_a 1
  906. .d 1 0
  907.     rtn
  908. .n 1 e_StdInt_dfromInt;#
  909. .o 1 0
  910. e_StdInt_nfromInt;#
  911.     push_node _cycle_in_spine 1
  912. .d 1 0
  913.     jsr ea22
  914. .o 1 0
  915.     push_a 0
  916.     fill ARRAY 1 _hnf 2
  917.     pop_a 1
  918. .d 1 0
  919.     rtn
  920. .o 1 0
  921. ea22
  922.     jsr_eval 0
  923.     pushI_a 0
  924.     pop_a 1
  925. .o 0 1 i
  926. e_StdInt_sfromInt;#
  927. .o 0 1 i
  928. s22
  929. .inline fromInt;#
  930. .d 0 1 i
  931.     jsr ItoAC
  932. .o 1 0
  933. .end
  934. .d 1 0
  935.     rtn
  936. .export e_StdInt_dmod
  937. .export e_StdInt_smod
  938. .export e_StdInt_nmod
  939. .desc e_StdInt_dmod e_StdInt_nmod e_StdInt_lmod 2 "mod"
  940. .o 2 0
  941. e_StdInt_lmod
  942.     repl_args 1 1
  943. .d 2 0
  944.     jsr ea23
  945. .o 0 1 i
  946.     buildI_b 0
  947.     pop_b 1
  948. .d 1 0
  949.     rtn
  950. .n 2 e_StdInt_dmod
  951. .o 1 0
  952. e_StdInt_nmod
  953.     push_node _cycle_in_spine 2
  954. .d 2 0
  955.     jsr ea23
  956. .o 0 1 i
  957.     fillI_b 0 0
  958.     pop_b 1
  959. .d 1 0
  960.     rtn
  961. .o 2 0
  962. ea23
  963.     jsr_eval 1
  964.     jsr_eval 0
  965.     pushI_a 1
  966.     pushI_a 0
  967.     pop_a 2
  968. .o 0 2 ii
  969. e_StdInt_smod
  970. .o 0 2 ii
  971. s23
  972. .inline mod
  973.     modI
  974. .end
  975. .d 0 1 i
  976.     rtn
  977. .export e_StdInt_drem
  978. .export e_StdInt_srem
  979. .export e_StdInt_nrem
  980. .desc e_StdInt_drem e_StdInt_nrem e_StdInt_lrem 2 "rem"
  981. .o 2 0
  982. e_StdInt_lrem
  983.     repl_args 1 1
  984. .d 2 0
  985.     jsr ea24
  986. .o 0 1 i
  987.     buildI_b 0
  988.     pop_b 1
  989. .d 1 0
  990.     rtn
  991. .n 2 e_StdInt_drem
  992. .o 1 0
  993. e_StdInt_nrem
  994.     push_node _cycle_in_spine 2
  995. .d 2 0
  996.     jsr ea24
  997. .o 0 1 i
  998.     fillI_b 0 0
  999.     pop_b 1
  1000. .d 1 0
  1001.     rtn
  1002. .o 2 0
  1003. ea24
  1004.     jsr_eval 1
  1005.     jsr_eval 0
  1006.     pushI_a 1
  1007.     pushI_a 0
  1008.     pop_a 2
  1009. .o 0 2 ii
  1010. e_StdInt_srem
  1011. .o 0 2 ii
  1012. s24
  1013. .inline rem
  1014.     push_b 1
  1015.     push_b 2
  1016.     push_b 2
  1017.     divI
  1018.     mulI
  1019.     update_b 0 2
  1020.     pop_b 1
  1021.     subI
  1022. .end
  1023. .d 0 1 i
  1024.     rtn
  1025. .export e_StdInt_dgcd
  1026. .export e_StdInt_sgcd
  1027. .export e_StdInt_ngcd
  1028. .desc e_StdInt_dgcd e_StdInt_ngcd e_StdInt_lgcd 2 "gcd"
  1029. .o 2 0
  1030. e_StdInt_lgcd
  1031.     repl_args 1 1
  1032. .d 2 0
  1033.     jsr ea25
  1034. .o 0 1 i
  1035.     buildI_b 0
  1036.     pop_b 1
  1037. .d 1 0
  1038.     rtn
  1039. .n 2 e_StdInt_dgcd
  1040. .o 1 0
  1041. e_StdInt_ngcd
  1042.     push_node _cycle_in_spine 2
  1043. .d 2 0
  1044.     jsr ea25
  1045. .o 0 1 i
  1046.     fillI_b 0 0
  1047.     pop_b 1
  1048. .d 1 0
  1049.     rtn
  1050. .o 2 0
  1051. ea25
  1052.     jsr_eval 1
  1053.     jsr_eval 0
  1054.     pushI_a 1
  1055.     pushI_a 0
  1056.     pop_a 2
  1057. .o 0 2 ii
  1058. e_StdInt_sgcd
  1059. .o 0 2 ii
  1060. s25
  1061.     push_b 1
  1062. .d 0 1 i
  1063.     jsr s10
  1064. .o 0 1 i
  1065.     push_b 1
  1066. .d 0 1 i
  1067.     jsr s10
  1068. .o 0 1 i
  1069.     update_b 1 3
  1070.     update_b 0 2
  1071.     pop_b 2
  1072. .d 0 2 ii
  1073.     jmp s1
  1074. .o 0 2 ii
  1075. s1
  1076.     eqI_b 0 1
  1077.     jmp_true case.8
  1078.     jmp case.9
  1079. case.8
  1080.     update_b 0 1
  1081.     pop_b 1
  1082. .d 0 1 i
  1083.     rtn
  1084. case.9
  1085.     push_b 1
  1086.     push_b 1
  1087.     update_b 1 2
  1088.     update_b 0 1
  1089.     pop_b 1
  1090.     modI
  1091.     push_b 1
  1092.     update_b 1 2
  1093.     update_b 0 1
  1094.     pop_b 1
  1095. .d 0 2 ii
  1096.     jmp s1
  1097. .export e_StdInt_dlcm
  1098. .export e_StdInt_slcm
  1099. .export e_StdInt_nlcm
  1100. .desc e_StdInt_dlcm e_StdInt_nlcm e_StdInt_llcm 2 "lcm"
  1101. .o 2 0
  1102. e_StdInt_llcm
  1103.     repl_args 1 1
  1104. .d 2 0
  1105.     jsr ea26
  1106. .o 0 1 i
  1107.     buildI_b 0
  1108.     pop_b 1
  1109. .d 1 0
  1110.     rtn
  1111. .n 2 e_StdInt_dlcm
  1112. .o 1 0
  1113. e_StdInt_nlcm
  1114.     push_node _cycle_in_spine 2
  1115. .d 2 0
  1116.     jsr ea26
  1117. .o 0 1 i
  1118.     fillI_b 0 0
  1119.     pop_b 1
  1120. .d 1 0
  1121.     rtn
  1122. .o 2 0
  1123. ea26
  1124.     jsr_eval 1
  1125.     pushI_a 1
  1126.     update_a 0 1
  1127.     pop_a 1
  1128. .o 1 1 i
  1129. e_StdInt_slcm
  1130. .o 1 1 i
  1131. s26
  1132.     eqI_b 0 0
  1133.     jmp_true case.10
  1134.     jmp case.11
  1135. case.10
  1136.     pop_a 1
  1137.     pop_b 1
  1138.     pushI 0
  1139. .d 0 1 i
  1140.     rtn
  1141. case.11
  1142.     jsr_eval 0
  1143.     eqI_a 0 0
  1144.     jmp_true case.12
  1145.     jmp case.13
  1146. case.12
  1147.     pop_a 1
  1148.     pop_b 1
  1149.     pushI 0
  1150. .d 0 1 i
  1151.     rtn
  1152. case.13
  1153.     push_b 0
  1154.     pushI_a 0
  1155. .d 0 2 ii
  1156.     jsr s25
  1157. .o 0 1 i
  1158.     pushI_a 0
  1159.     pop_a 1
  1160.     divI
  1161.     push_b 1
  1162.     push_b 1
  1163.     update_b 1 2
  1164.     update_b 0 1
  1165.     pop_b 1
  1166.     update_b 1 2
  1167.     update_b 0 1
  1168.     pop_b 1
  1169.     mulI
  1170. .d 0 1 i
  1171.     jmp s10
  1172. .export e_StdInt_disEven
  1173. .export e_StdInt_sisEven
  1174. .export e_StdInt_nisEven
  1175. .desc e_StdInt_disEven e_StdInt_nisEven e_StdInt_lisEven 1 "isEven"
  1176. .o 2 0
  1177. e_StdInt_lisEven
  1178.     pop_a 1
  1179. .d 1 0
  1180.     jsr ea27
  1181. .o 0 1 b
  1182.     buildB_b 0
  1183.     pop_b 1
  1184. .d 1 0
  1185.     rtn
  1186. .n 1 e_StdInt_disEven
  1187. .o 1 0
  1188. e_StdInt_nisEven
  1189.     push_node _cycle_in_spine 1
  1190. .d 1 0
  1191.     jsr ea27
  1192. .o 0 1 b
  1193.     fillB_b 0 0
  1194.     pop_b 1
  1195. .d 1 0
  1196.     rtn
  1197. .o 1 0
  1198. ea27
  1199.     jsr_eval 0
  1200.     pushI_a 0
  1201.     pop_a 1
  1202. .o 0 1 i
  1203. e_StdInt_sisEven
  1204. .o 0 1 i
  1205. s27
  1206. .inline isEven
  1207.     pushI 1
  1208.     and%
  1209.     pushI 0
  1210.     eqI
  1211. .end
  1212. .d 0 1 b
  1213.     rtn
  1214. .export e_StdInt_disOdd
  1215. .export e_StdInt_sisOdd
  1216. .export e_StdInt_nisOdd
  1217. .desc e_StdInt_disOdd e_StdInt_nisOdd e_StdInt_lisOdd 1 "isOdd"
  1218. .o 2 0
  1219. e_StdInt_lisOdd
  1220.     pop_a 1
  1221. .d 1 0
  1222.     jsr ea28
  1223. .o 0 1 b
  1224.     buildB_b 0
  1225.     pop_b 1
  1226. .d 1 0
  1227.     rtn
  1228. .n 1 e_StdInt_disOdd
  1229. .o 1 0
  1230. e_StdInt_nisOdd
  1231.     push_node _cycle_in_spine 1
  1232. .d 1 0
  1233.     jsr ea28
  1234. .o 0 1 b
  1235.     fillB_b 0 0
  1236.     pop_b 1
  1237. .d 1 0
  1238.     rtn
  1239. .o 1 0
  1240. ea28
  1241.     jsr_eval 0
  1242.     pushI_a 0
  1243.     pop_a 1
  1244. .o 0 1 i
  1245. e_StdInt_sisOdd
  1246. .o 0 1 i
  1247. s28
  1248. .inline isOdd
  1249.     pushI 1
  1250.     and%
  1251.     pushI 0
  1252.     eqI
  1253.     notB
  1254. .end
  1255. .d 0 1 b
  1256.     rtn
  1257. .export e_StdInt_dbitor
  1258. .export e_StdInt_sbitor
  1259. .export e_StdInt_nbitor
  1260. .desc e_StdInt_dbitor e_StdInt_nbitor e_StdInt_lbitor 2 "bitor"
  1261. .o 2 0
  1262. e_StdInt_lbitor
  1263.     repl_args 1 1
  1264. .d 2 0
  1265.     jsr ea29
  1266. .o 0 1 i
  1267.     buildI_b 0
  1268.     pop_b 1
  1269. .d 1 0
  1270.     rtn
  1271. .n 2 e_StdInt_dbitor
  1272. .o 1 0
  1273. e_StdInt_nbitor
  1274.     push_node _cycle_in_spine 2
  1275. .d 2 0
  1276.     jsr ea29
  1277. .o 0 1 i
  1278.     fillI_b 0 0
  1279.     pop_b 1
  1280. .d 1 0
  1281.     rtn
  1282. .o 2 0
  1283. ea29
  1284.     jsr_eval 1
  1285.     jsr_eval 0
  1286.     pushI_a 1
  1287.     pushI_a 0
  1288.     pop_a 2
  1289. .o 0 2 ii
  1290. e_StdInt_sbitor
  1291. .o 0 2 ii
  1292. s29
  1293. .inline bitor
  1294.     or%
  1295. .end
  1296. .d 0 1 i
  1297.     rtn
  1298. .export e_StdInt_dbitand
  1299. .export e_StdInt_sbitand
  1300. .export e_StdInt_nbitand
  1301. .desc e_StdInt_dbitand e_StdInt_nbitand e_StdInt_lbitand 2 "bitand"
  1302. .o 2 0
  1303. e_StdInt_lbitand
  1304.     repl_args 1 1
  1305. .d 2 0
  1306.     jsr ea30
  1307. .o 0 1 i
  1308.     buildI_b 0
  1309.     pop_b 1
  1310. .d 1 0
  1311.     rtn
  1312. .n 2 e_StdInt_dbitand
  1313. .o 1 0
  1314. e_StdInt_nbitand
  1315.     push_node _cycle_in_spine 2
  1316. .d 2 0
  1317.     jsr ea30
  1318. .o 0 1 i
  1319.     fillI_b 0 0
  1320.     pop_b 1
  1321. .d 1 0
  1322.     rtn
  1323. .o 2 0
  1324. ea30
  1325.     jsr_eval 1
  1326.     jsr_eval 0
  1327.     pushI_a 1
  1328.     pushI_a 0
  1329.     pop_a 2
  1330. .o 0 2 ii
  1331. e_StdInt_sbitand
  1332. .o 0 2 ii
  1333. s30
  1334. .inline bitand
  1335.     and%
  1336. .end
  1337. .d 0 1 i
  1338.     rtn
  1339. .export e_StdInt_dbitxor
  1340. .export e_StdInt_sbitxor
  1341. .export e_StdInt_nbitxor
  1342. .desc e_StdInt_dbitxor e_StdInt_nbitxor e_StdInt_lbitxor 2 "bitxor"
  1343. .o 2 0
  1344. e_StdInt_lbitxor
  1345.     repl_args 1 1
  1346. .d 2 0
  1347.     jsr ea31
  1348. .o 0 1 i
  1349.     buildI_b 0
  1350.     pop_b 1
  1351. .d 1 0
  1352.     rtn
  1353. .n 2 e_StdInt_dbitxor
  1354. .o 1 0
  1355. e_StdInt_nbitxor
  1356.     push_node _cycle_in_spine 2
  1357. .d 2 0
  1358.     jsr ea31
  1359. .o 0 1 i
  1360.     fillI_b 0 0
  1361.     pop_b 1
  1362. .d 1 0
  1363.     rtn
  1364. .o 2 0
  1365. ea31
  1366.     jsr_eval 1
  1367.     jsr_eval 0
  1368.     pushI_a 1
  1369.     pushI_a 0
  1370.     pop_a 2
  1371. .o 0 2 ii
  1372. e_StdInt_sbitxor
  1373. .o 0 2 ii
  1374. s31
  1375. .inline bitxor
  1376.     xor%
  1377. .end
  1378. .d 0 1 i
  1379.     rtn
  1380. .export e_StdInt_d<<
  1381. .export e_StdInt_s<<
  1382. .export e_StdInt_n<<
  1383. .desc e_StdInt_d<< e_StdInt_n<< e_StdInt_l<< 2 "<<"
  1384. .o 2 0
  1385. e_StdInt_l<<
  1386.     repl_args 1 1
  1387. .d 2 0
  1388.     jsr ea32
  1389. .o 0 1 i
  1390.     buildI_b 0
  1391.     pop_b 1
  1392. .d 1 0
  1393.     rtn
  1394. .n 2 e_StdInt_d<<
  1395. .o 1 0
  1396. e_StdInt_n<<
  1397.     push_node _cycle_in_spine 2
  1398. .d 2 0
  1399.     jsr ea32
  1400. .o 0 1 i
  1401.     fillI_b 0 0
  1402.     pop_b 1
  1403. .d 1 0
  1404.     rtn
  1405. .o 2 0
  1406. ea32
  1407.     jsr_eval 1
  1408.     jsr_eval 0
  1409.     pushI_a 1
  1410.     pushI_a 0
  1411.     pop_a 2
  1412. .o 0 2 ii
  1413. e_StdInt_s<<
  1414. .o 0 2 ii
  1415. s32
  1416. .inline <<
  1417.     shiftl%
  1418. .end
  1419. .d 0 1 i
  1420.     rtn
  1421. .export e_StdInt_d>>
  1422. .export e_StdInt_s>>
  1423. .export e_StdInt_n>>
  1424. .desc e_StdInt_d>> e_StdInt_n>> e_StdInt_l>> 2 ">>"
  1425. .o 2 0
  1426. e_StdInt_l>>
  1427.     repl_args 1 1
  1428. .d 2 0
  1429.     jsr ea33
  1430. .o 0 1 i
  1431.     buildI_b 0
  1432.     pop_b 1
  1433. .d 1 0
  1434.     rtn
  1435. .n 2 e_StdInt_d>>
  1436. .o 1 0
  1437. e_StdInt_n>>
  1438.     push_node _cycle_in_spine 2
  1439. .d 2 0
  1440.     jsr ea33
  1441. .o 0 1 i
  1442.     fillI_b 0 0
  1443.     pop_b 1
  1444. .d 1 0
  1445.     rtn
  1446. .o 2 0
  1447. ea33
  1448.     jsr_eval 1
  1449.     jsr_eval 0
  1450.     pushI_a 1
  1451.     pushI_a 0
  1452.     pop_a 2
  1453. .o 0 2 ii
  1454. e_StdInt_s>>
  1455. .o 0 2 ii
  1456. s33
  1457. .inline >>
  1458.     shiftr%
  1459. .end
  1460. .d 0 1 i
  1461.     rtn
  1462. .export e_StdInt_dbitnot
  1463. .export e_StdInt_sbitnot
  1464. .export e_StdInt_nbitnot
  1465. .desc e_StdInt_dbitnot e_StdInt_nbitnot e_StdInt_lbitnot 1 "bitnot"
  1466. .o 2 0
  1467. e_StdInt_lbitnot
  1468.     pop_a 1
  1469. .d 1 0
  1470.     jsr ea34
  1471. .o 0 1 i
  1472.     buildI_b 0
  1473.     pop_b 1
  1474. .d 1 0
  1475.     rtn
  1476. .n 1 e_StdInt_dbitnot
  1477. .o 1 0
  1478. e_StdInt_nbitnot
  1479.     push_node _cycle_in_spine 1
  1480. .d 1 0
  1481.     jsr ea34
  1482. .o 0 1 i
  1483.     fillI_b 0 0
  1484.     pop_b 1
  1485. .d 1 0
  1486.     rtn
  1487. .o 1 0
  1488. ea34
  1489.     jsr_eval 0
  1490.     pushI_a 0
  1491.     pop_a 1
  1492. .o 0 1 i
  1493. e_StdInt_sbitnot
  1494. .o 0 1 i
  1495. s34
  1496. .inline bitnot
  1497.     not%
  1498. .end
  1499. .inline lcm
  1500. .end
  1501. .inline gcd
  1502. .end
  1503. .inline abs;i
  1504. .end
  1505. .inline sign;i
  1506. .end
  1507. .inline ^;i
  1508. .end
  1509. .d 0 1 i
  1510.     rtn
  1511.